package com.google.zxing.client.android;



 
 
 
import android.app.Activity;
 
import android.app.ProgressDialog;
 
import android.os.Bundle;
 
import android.os.Handler;
 
import android.widget.TextView;
 
 
 
public class TestLayout extends Activity {
 
        private Handler handler = new Handler();
 
        private String strTest = null;
 
        ProgressDialog myProgressDialog = null;
 
       
 
    /** Called when the activity is first created. */
 
    @Override
 
    public void onCreate(Bundle savedInstanceState) {
 
        super.onCreate(savedInstanceState);
 
        setContentView(R.layout.main);
 
        mainProcessing();
 
    }
 
 
 
        private void mainProcessing() {
 
                Thread thread =  new Thread(null, doBackgroundProc, "Background2");
 
                thread.start();
 
                myProgressDialog = ProgressDialog.show(TestLayout.this,    
 
                "Please wait...", "Doing Extreme Calculations...", true);
 
        }
 
       
 
        private void returnRes(){
 
                TextView tvBal = new TextView(this.getApplicationContext());
 
 
                myProgressDialog.dismiss();
 
        }
 
       
 
        private Runnable doBackgroundProc = new Runnable(){
 
                public void run(){
 
                        backgroundProc();
 
                }
 
        };
 
       
 
        private void backgroundProc(){ 
 
                try{
 
            // Do some Fake-Work
 
            Thread.sleep(2000);
 
       } catch (Exception e) {  }
 
       myProgressDialog.dismiss();
       // strTest = "123";
 
          //      handler.post(doReturnRes);
 
        }
 
       
 
        private Runnable doReturnRes = new Runnable(){
 
                public void run(){
 
                        returnRes();
 
                }
 
        };
 
       
 
}
 
 

